package cn.base.day08;

import java.util.Scanner;

public class Test02 {
    public static void main(String[] args) {
        String username = "李四";
        String password = "123456";
        Scanner sc = new Scanner(System.in);
        for (int i = 0; i < 3; i++) {
            System.out.println("请输入用户名");
            String uName = sc.next();
            System.out.println("请输入密码");
            String pwd = sc.next();
            if (uName.equals(username) && pwd.equals(password)) {
                System.out.println("登录成功！！！");
                break;
            } else {
                if (i == 2) {
                    System.out.println("账户锁定，请十分钟后再试");
                } else {
                    System.out.println("登录失败，您还有" + (2 - i) + "次机会");
                }
            }
        }
    }
}
